﻿<?php

include("class.base.php");
if (!$sess = sisse_logitud()) { header("Location: index.php"); die(); }
if ($grupi_oigused = grupi_oigused($sess)) {
	if ($grupi_oigused < 2) {
		header("Location: index.php"); die();
	}
}
else {
	header("Location: index.php"); die();
}

if (isset($_GET["t"]) and isset($_GET["u"]) and isset($_GET["id"]) and isset($_GET["ref"])) {
	$xtabel = htmlspecialchars($_GET["t"], ENT_QUOTES);
	$tabel1 = kriips($xtabel);
	$u = htmlspecialchars($_GET["u"], ENT_QUOTES);
	$sisu = "
		<table class='colspace'>
			<tr><td><a href='".$_GET["ref"].".php?t=".$_GET["u"]."&id=".$_GET["id"]."'>".str_replace("{TABEL}", kriips($u), $lang["tagasi_juurde"])."</a></td></tr>
		</table>";
}
else {
	$sisu = "";
	$lisa = 0;
}
$pealkiri1 = $lang["lisa"];
        $sisu .=<<<SISU
        <table class="colspace" id="default">
        <tr><td><a href="abi.php?t=lisa" target="_blank">$lang[lisamise_abi]</a></td></tr>
        <tr><td>$lang[lisa_paremalt]</td></tr>
        </table>
		<span id="content"></span>
SISU;
include("kujundus.php");
?>